//
//  ResultView.m
//  Cook
//
//  Created by 0.0 on 15-4-20.
//  Copyright (c) 2015年 dingjun. All rights reserved.
//

#import "ResultView.h"

@implementation ResultView

- (void)dealloc
{
    [_nameLabel release];
    [_cancelButton release];
    
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    
    if (self) {
        self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height / 2)];
        self.nameLabel.layer.borderWidth = 0.5f;
        self.nameLabel.layer.cornerRadius = 10.0f;
        self.nameLabel.layer.masksToBounds = YES;
        self.cancelButton = [[UIButton alloc] initWithFrame:CGRectMake(_nameLabel.bounds.origin.x + (_nameLabel.bounds.size.width - _nameLabel.bounds.size.height), _nameLabel.bounds.origin.y, _nameLabel.frame.size.height, _nameLabel.frame.size.height)];
//        self.nameLabel.backgroundColor = [UIColor redColor];
//        self.cancelButton.backgroundColor = [UIColor yellowColor];

        [self.cancelButton setTitle:@"X" forState:UIControlStateNormal];
        self.cancelButton.titleLabel.font = [UIFont systemFontOfSize:20.0f];
//        self.cancelButton.layer.cornerRadius = self.cancelButton.frame.size.width / 2;
        [self.cancelButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
//        self.cancelButton.layer.borderWidth = 0.5f;
        
        [self addSubview:_nameLabel];
        [self addSubview:_cancelButton];
        
        [_nameLabel release];
        [_cancelButton release];
    }
    
    return self;
}

@end
